package Thread;
//倒计时程序 输入一个数字 从该数字开始每秒递减 到0时输出时间到
import java.util.Scanner;

//sleep 阻塞
public class SleepDemo {
    public static void main(String[] args) {
        System.out.println("请输入数字");
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        for (int i=a;i>=0;i--){
            System.out.println(i);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

        System.out.println("时间到");
    }
}
